SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE dbo.[DnnProduct_GetBannerGroups]
	@PortalID int
AS

SELECT  GroupName
FROM dbo.DnnProduct_Banners
INNER JOIN dbo.DnnProduct_Vendors ON 
	dbo.DnnProduct_Banners.VendorId = dbo.DnnProduct_Vendors.VendorId
WHERE (dbo.DnnProduct_Vendors.PortalId = @PortalID) OR 
	(@PortalID is null and dbo.DnnProduct_Vendors.PortalId is null)
GROUP BY GroupName
ORDER BY GroupName


GO
